<?php

/*
|--------------------------------------------------------------------------
| Application Routes
|--------------------------------------------------------------------------
|
| Here is where you can register all of the routes for an application.
| It is a breeze. Simply tell Lumen the URIs it should respond to
| and give it the Closure to call when that URI is requested.
|
*/

$router->get('/', function () use ($router) {
    return $router->app->version();
});

//模板消息
$router->group(['prefix' => 'mess', 'middleware' => 'cors'], function () use ($router) {
    $router->get('/jump_url', 'MessTemplateController@jump_url');
    $router->get('/save_unionid', 'MessTemplateController@save_unionid');
    $router->get('/sendTemplate', 'MessTemplateController@sendTemplate');
    $router->get('/formal_send', 'MessTemplateController@formal_send');
});

// 微信授权
$router->group(['prefix' => 'wechat', 'middleware' => 'cors'], function () use ($router) {
    $router->get('/profile', 'WechatController@profile');
    $router->get('/callback', 'WechatController@callback');
});

//支付宝会员卡
$router->group(['prefix' => 'card', 'middleware' => 'cors'], function () use ($router) {
    $router->get('/get_cart', 'CardController@get_cart');
});
